package edu.unmsm.ocaa.sisocaa.integracion.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;

import edu.unmsm.ocaa.sisocaa.integracion.dao.Rep1DAO;
import edu.unmsm.ocaa.sisocaa.negocio.model.dto.Rep1DTO;

@Repository
public class Rep1DAOImpl extends SqlMapClientDaoSupport implements Rep1DAO {

	@Autowired
	public Rep1DAOImpl(SqlMapClient sql) {
		super.setSqlMapClient(sql);
		// TODO Auto-generated constructor stub
	}

	@Override
	public List<Rep1DTO> selectRep1(Integer idFicha) throws DataAccessException {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().queryForList("getRep1", idFicha);
	}

	@Override
	public List<Rep1DTO> selectRep1xDep(Integer idFicha, Integer idDep)
			throws DataAccessException {
		// TODO Auto-generated method stub
		Map map=new HashMap();
		map.put("id_ficha", idFicha);
		map.put("id_dep", idDep);
		return getSqlMapClientTemplate().queryForList("getRep1xDep", map);
	}

}
